package com.bz.xtcx.manager.mapper;

import java.util.List;

import org.apache.ibatis.annotations.*;

import com.bz.xtcx.manager.entity.BusUserCheck;

public interface BusUserCheckMapper {
	
	@Insert("insert into `bus_user_form_check`(form_id, check_status, info, checker)"
		    + " VALUES(#{formId, jdbcType=VARCHAR},"
		    + " #{checkStatus, jdbcType=INTEGER},"
		    + " #{info, jdbcType=VARCHAR},"
		    + " #{checker, jdbcType=VARCHAR})"
		    )
	@Options(useGeneratedKeys = true, keyProperty = "id")  
	int insert(BusUserCheck e);
	
	@Select("select * from `bus_user_form_check` where form_id = #{formId}")
	@Results(
			id = "busUserCheck",
			value = {
			    @Result(id = true, property = "id", column = "id"),
			    @Result(property = "formId", column = "form_id"),
			    @Result(property = "checkStatus", column = "check_status"),
			    @Result(property = "info", column = "info"),
			    @Result(property = "checker", column = "checker"),
			    @Result(property = "checkTime", column = "check_time")
		    }
		)
	List<BusUserCheck> findByFormId(String formId);

	@Delete("delete from `bus_user_form_check` where form_id = #{formId}")
	int delByFormId(String formId);
}
